/**
 * Created by Aber on 17/3/23.
 */
// 加载模块
module.exports = function(ngModule) {
    require('./note-show.scss');
    ngModule.directive('noteShow',function () {
        return {
            restrict: 'E',//元素(element)
            scope: true,
            replace: true,
            template: require('./note-show.html'),//模板
            controllerAs: 'note-show',// <=> $scope.vm = {greeting: '你好，我是卡哥'}
            controller: function ($scope) {
                $scope.addUserList=function () {
                    $scope.setWrapData.add({"title":"个人笔记","templete":"noted",id:"s1"})
                }
                $scope.addTeamList=function () {
                    sessionStorage.removeItem("team")
                    layer.open({
                        type: 2,
                        title: '选择设置团队',
                        shadeClose: true,
                        shade: 1,
                        area: ['70%', '90%'],
                        content: location.origin+"/webpack/src/pages/layer/selectProject.html",
                        end:function () {
                            if(sessionStorage.hasOwnProperty("team")){
                                $scope.setWrapData.add({"title":"团队笔记","templete":"team",id:"s2"})
                            }
                        }
                    });
                }
                $scope.addLunList=function () {
                    $scope.setWrapData.add({"title":"论坛笔记","templete":"lun",id:"s3"})
                }
            }
        }
    });//定义指令，对应页面中的<hello-world></hello-world>
}